﻿<UserControl x:Class="Vibstudio.NetConfigurator.UI.Views.ResultCompositionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Grid x:Name="ResultGrid"
          Grid.Column="1"
          Grid.Row="0"
          Margin="3,5,5,3">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="50" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="150" />
        </Grid.RowDefinitions>
        <Label Grid.Column="0"
               Grid.Row="0"
               Padding="0"
               HorizontalContentAlignment="Center"
               VerticalContentAlignment="Center"
               Content="{Binding Path=Result, Converter={StaticResource ResultConverter}, ConverterParameter=CompositionResultMessageContent}"
               Foreground="{Binding Path=Result, Converter={StaticResource ResultConverter}, ConverterParameter=ResultMessageForeground}" />
        <ListView Grid.Column="0"
                  Grid.Row="1"
                  Margin="10"
                  ItemsSource="{Binding Result, UpdateSourceTrigger=PropertyChanged}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="{Binding ApplicationColumnName, UpdateSourceTrigger=PropertyChanged}"
                                    DisplayMemberBinding="{Binding Path=Application}" />
                    <GridViewColumn Header="{Binding ConfigurationColumnName, UpdateSourceTrigger=PropertyChanged}"
                                    DisplayMemberBinding="{Binding Path=Configuration}" />
                    <GridViewColumn Header="{Binding OutcomeColumnName, UpdateSourceTrigger=PropertyChanged}"
                                    DisplayMemberBinding="{Binding Path=IsValid}" />
                    <GridViewColumn Header="{Binding MessageColumnName, UpdateSourceTrigger=PropertyChanged}"
                                    DisplayMemberBinding="{Binding Path=Message}" />
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Grid.Column="1"
                    Grid.Row="1"
                    Margin="0,4">
            <Button Command="{Binding GoToHomeCommand}"
                    Template="{StaticResource GoToHomeButton}"
                    ClickMode="Release"
                    BorderThickness="0"
                    BorderBrush="Transparent"
                    VerticalAlignment="Top">
                <Button.ToolTip>
                    <ToolTip Content="{Binding GoToHomeToolTip, UpdateSourceTrigger=PropertyChanged}"
                             Template="{DynamicResource InformationToolTip}" />
                </Button.ToolTip>
            </Button>
        </StackPanel>
    </Grid>
</UserControl>